﻿Public Class level1
    Dim xSoal As String
    Dim xJawaban As String
    Dim xPilihan As String
    Dim xindexsoal As Integer = 0
    Dim checked As Integer = 0
    Property jumSoal As Integer
    Public Property IndexSoal As String
        Get
            Return xindexsoal
        End Get
        Set(ByVal value As String)
            xindexsoal = value
        End Set
    End Property
    Public Property Soal As String
        Get
            Return xSoal
        End Get
        Set(ByVal value As String)
            xSoal = value
        End Set
    End Property
    Public Property Jawaban As String
        Get
            Return xJawaban
        End Get
        Set(ByVal value As String)
            xJawaban = value
        End Set
    End Property
    Public Property Pilihan As String
        Get
            Return xPilihan
        End Get
        Set(ByVal value As String)
            xPilihan = value
        End Set
    End Property

    Public Sub refreshSoal()
        Label1.Text = xSoal & " ? "
        Dim xPilihan1() As String = Split(xPilihan, ";")
        'MsgBox(xPilihan)
        RadioButton1.Text = xPilihan1(0)
        RadioButton2.Text = xPilihan1(1)
        RadioButton3.Text = xPilihan1(2)
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        If RadioButton1.Checked = True Then
            checked = 1
        ElseIf RadioButton2.Checked = True Then
            checked = 2
        ElseIf RadioButton3.Checked = True Then
            checked = 3
        End If

        If checked <> Jawaban Then
            MsgBox("Answer Wrong")
        Else
            'mainform.scorelevel1 += 10
            Me.Dispose()

            If xindexsoal = jumSoal Then
                'Dim nama As String = InputBox("input your name", "name")

                'MsgBox(nama & " = " & mainform.scorelevel1)
                'System.IO.File.AppendAllText("log.txt", "level1;" & nama & ";" & mainform.scorelevel1)

                'mainform.scorelevel1 = 0
                basic.Close()
            End If
        End If

        'If checked = Jawaban Then
        'mainform.scorelevel1 += 10
        'End If


    End Sub

    Private Sub level1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        'System.IO.File.WriteAllText("log.txt", "a")
        'Console.WriteLine("a") 
    End Sub

End Class
